<% content_for :content do %>

  <!-- widget grid -->
  <section id="widget-grid" class="">
  
    <!-- row -->
    <div class="row">
  
      <!-- NEW WIDGET START -->
      <article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  
        <!-- Widget ID (each widget will need unique ID)-->
        <div class="jarviswidget jarviswidget-color-darken" id="wid-id-1" data-widget-editbutton="false" data-widget-colorbutton="false" data-widget-deletebutton="false">
          <!-- widget options:
          usage: <div class="jarviswidget" id="wid-id-0" data-widget-editbutton="false">

          data-widget-colorbutton="false"
          data-widget-editbutton="false"
          data-widget-togglebutton="false"
          data-widget-deletebutton="false"
          data-widget-fullscreenbutton="false"
          data-widget-custombutton="false"
          data-widget-collapsed="true"
          data-widget-sortable="false"

          -->
          <header>
            <span class="widget-icon"> <i class="fa fa-table"></i> </span>
            <h2>广告列表</h2>
          </header>

          <!-- widget div-->
          <div>

            <!-- widget edit box -->
            <div class="jarviswidget-editbox">
              <!-- This area used as dropdown edit box -->
            </div>
            <!-- end widget edit box -->

            <!-- widget content -->
            <div class="widget-body no-padding">
              <div class="alert alert-info no-margin fade in">
                <span class="">
                  <i class="fa-fw fa fa-info"></i>共有<%= @advertise_groups.total_count %>条记录
                </span>
                <span class="col-md-offset">
                  <%= link_to "添加新广告", new_admin_recruitment_group_path, :class => 'btn btn-default btn-sm ', :remote => true if current_admin.can?(controller: "admin/recruitment_groups", action: "new") %>
                </span>
              </div>

              <table class="table table-bordered table-striped">
                <thead>
                  <tr>
                    <th>广告规则</th>
                    <th>区域</th>
                    <th>城市列表</th>
                    <th>有效期</th>
                    <th>创建/修改时间</th>
                    <th>操作</th>
                  </tr>
                </thead>
                <tbody>
                <% @advertise_groups.each do |item| %>
                  <tr id='advertise_group-list-<%= item.id %>'>
                    <td nowrap="nowrap">
                      <%= link_to item.name,admin_recruitment_group_path(item) %>
                    </td>
                    <td nowrap="nowrap"><%= link_to '修改',rules_admin_recruitment_group_path(item),remote: true if current_admin.can?(controller: "admin/recruitment_groups",action: "rules") %></td>
                    <td style="word-wrap:break-word; word-break:break-all;"><%= item.display_advertise_rules.html_safe %></td>
                    <td nowrap="nowrap"><%= item.start_at %> - <%= item.end_at %></td>
                    <td nowrap="nowrap">
                      <%= item.created_at.stamp("2013-03-12 22:01:22") %>
                    </td>
                    <td nowrap="nowrap">
                      <%= link_to '编辑', edit_admin_recruitment_group_path(item), remote: true if current_admin.can?(controller: "admin/recruitment_groups", action: "edit") %>
                      <%= link_to '删除', admin_recruitment_group_path(item), method: :delete, remote: true, confirm: '是否确定删除?' if current_admin.can?(controller: "admin/recruitment_groups",action: "destroy") %>
                    </td>
                  </tr>
                <% end %>
                </tbody>
              </table>
              <div class="dt-row dt-bottom-row"><div class="row"><div class="col-sm-6"><div class="dataTables_info" id="datatable_fixed_column_info"></div></div><div class="col-sm-6 text-right"><%= paginate @advertise_groups %></div></div></div>
            </div>
            <!-- end widget content -->

          </div>
          <!-- end widget div -->

        </div>
        <!-- end widget -->
  
      </article>
      <!-- WIDGET END -->

    </div>
  
    <!-- end row -->

  </section>
  <!-- end widget grid -->
<% end %>